package com.seuic.hnjiningposapp.hnapps.ui.view.dialog;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.seuic.hnjiningposapp.R;
import com.seuic.hnjiningposapp.hnapps.ui.activity.SpecialBusinessActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 口头挂失 获取账户的方式
 */
public class SelGetNumPp extends BasePopupView {
    Unbinder bind;
    @BindView(R.id.re_input_handto_btn)
    LinearLayout reInputHandtoBtn;
    @BindView(R.id.re_input_read_btn)
    LinearLayout reInputReadBtn;
    SelGetNumTypeCallBack mSelGetNumTypeCallBack;

    public SelGetNumPp(@NonNull Context context, SelGetNumTypeCallBack selGetNumTypeCallBack) {
        super(context);
        this.mSelGetNumTypeCallBack = selGetNumTypeCallBack;
    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.sel_getnum_pp;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        bind = ButterKnife.bind(this);


    }

    @OnClick({R.id.re_input_handto_btn, R.id.re_input_read_btn})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.re_input_handto_btn:
                //手输入
                mSelGetNumTypeCallBack.SelGetNumType(SpecialBusinessActivity.HEADERGET);
                break;
            case R.id.re_input_read_btn:
                //读卡
                mSelGetNumTypeCallBack.SelGetNumType(SpecialBusinessActivity.READGET);
                break;
        }
    }

    public interface SelGetNumTypeCallBack {
        void SelGetNumType(String TYPE);
    }
    @Override
    protected void onDismiss() {
        super.onDismiss();
        //注解解绑
        if (bind != null && bind != Unbinder.EMPTY) {
            bind.unbind();
        }
        this.bind = null;
    }


}
